package com.example.demo.config;

import cn.dev33.satoken.interceptor.SaInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/*
 * @Author:大力王
 * @Date:2024/3/31-31-4:39
 * 开始了
 */
public class SaTokenConfigure implements WebMvcConfigurer {
    // 注册 Sa-Token 拦截器，打开注解式鉴权功能
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 注册 Sa-Token 拦截器，打开注解式鉴权功能
        registry.addInterceptor(new SaInterceptor())
                .addPathPatterns("/**");
//                .excludePathPatterns("/user/login")
//                .excludePathPatterns("/user/register")
//                .excludePathPatterns("/user/registerByPhone")
//                .excludePathPatterns("/user/getVerificationCode/{phoneNumber}");
            }
}
